<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
	.main {
		margin: 100px auto;
		text-align: center;
	}
	#txt {
		height: 50px;
	}
	#btn {
		height: 50px;
		width: 100px;
	}
	</style>
</head>
<body>
	<div class="main">
		<input type="text" id='txt'>
		<input type="button" id='btn' value="禁用">
	</div>
	<script type="text/javascript">
		var btn = document.getElementById('btn');
		btn.onclick = function() {
			var txt = document.getElementById('txt');
			txt.disabled = true;
		}
	</script>
</body>
</html>